/*
 * @Author: 罗微
 * @Date: 2020-09-21 20:05:43
 * @LastEditors: MiNine
 * @LastEditTime: 2020-09-23 20:18:04
 * @Description: 
 */
import axios from '../../axios'
const CLAIM_ORDER_ID = "/claimOrder";
const claimOrderApi = {
    //     新增理赔订单
    // 接收传过来的需要理赔的保险订单
    addClaimOrder: function(data) {
        return axios({
            url: CLAIM_ORDER_ID + "/addCompensation",
            method: "post",
            data
        });
    },

    // 根据订单id删除理赔订单delCompensation
    delCompensation: function(data) {
        console.log(data);
        return axios({
            url: CLAIM_ORDER_ID + "/delCompensation",
            method: "post",
            data
        });
    },

    // 得到新的理赔信息修改理赔信息
    modCompensation: function(data) {
        return axios({
            url: CLAIM_ORDER_ID + "/modCompensation",
            method: "post",
            data
        });
    },

    // 修改理赔状态
    modClaim: function(data) {
        return axios({
            url: CLAIM_ORDER_ID + "/modClaim",
            method: "post",
            data
        });
    },

    // 查看所有理赔申请
    getClaims: function(_id) {
        return axios({
            url: CLAIM_ORDER_ID + "/getClaims",
            method: "post",
            data: {
                _id
            }
        });
    },

    // 查看当前用户的所有理赔信息
    getCompensations: function(params) {
        return axios({
            url: CLAIM_ORDER_ID + "/getCompensations",
            method: "get",
            params: {
                _id: params
            }
        });
    },

    updateClaimOrder(data){
        return axios({
            url: CLAIM_ORDER_ID + "/updateClaim",
            method: "post",
            data
        });
    }
}

export default claimOrderApi